jemalloc-ctl 0.2.0

jemalloc control and introspection
Documentation

jemalloc-ctl

CircleCI

Documentation

jemalloc control and introspection.

Example

extern crate jemallocator;
extern crate jemalloc_ctl;

use std::thread;
use std::time::Duration;

#[global_allocator]
static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;

fn main() {
    loop {
        // many statistics are cached and only updated when the epoch is advanced.
        jemalloc_ctl::epoch().unwrap();

        let allocated = jemalloc_ctl::stats::allocated().unwrap();
        let resident = jemalloc_ctl::stats::resident().unwrap();
        println!("{} bytes allocated/{} bytes resident", allocated, resident);
        thread::sleep(Duration::from_secs(10));
    }
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.